package cn.cloud9;

public class Demo13ReverseString {
    /**
     *
     * @param args
     */
    public static void main(String[] args) {
        String target = "abc";
        System.out.println(reverse(target));
    }

    private static String reverse(String reverse) {
        int length = reverse.length();
        char[] reverseChars = new char[length];
        for (int i = length - 1, a = 0; i >= 0; i--, a++) {
            reverseChars[a] = reverse.charAt(i);
        }
        return String.valueOf(reverseChars);
    }
}
